<%@ page language="java" pageEncoding="UTF-8"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>insert_user.jsp</title>
    <link href="../style/main.css" rel="stylesheet" type="text/css" />
    <link href="../style/ZuCe.css" rel="stylesheet" type="text/css" />
    <link href="../style/table.css" rel="stylesheet" type="text/css" />
    <style type="text/css" language="java">
	    body{margin:0 auto;padding:0;font:12px Arial, Helvetica, sans-serif; text-align:center}
    </style>
    
 </head>
  <body>
<%
 if(request.getAttribute("error")!=null){
	      out.println(request.getAttribute("error").toString());
	   }
 %>
		<div class="MainTop"><img src="../images/maintopright.gif" /></div>
	    <div class="MainBar">
	    	<p style="text-indent:2em; text-align:left"> 你现在的位置: > >用户资料</p>
	    </div>
			<div id="WrapUser">
			<!-- 如果是admin,可查询所有的用户信息，其他用户只能看到自己的资料（简单的：用户名，密码） -->
				<logic:present name="loginForm" scope="session" > 
					<logic:notEqual name="loginForm" property="user_name" value="admin">
					
				    	<ul>
				        	<li><span style="color:red">*</span>用户名:</li>
				            <li><bean:write name="loginForm" property="user_name" /></li>
				        </ul>
				        <ul>
				        	<li><span style="color:red">*</span>密&nbsp;&nbsp;码:</li>
				            <li><bean:write name="loginForm" property="password" /></li>
				        </ul>
			
				    </logic:notEqual>
		 </div>
		    <logic:equal name="loginForm" property="user_name" value="admin">
		    	<logic:present name="userList" scope="request">
		    	<div id="container">
		    		<div id="content">
				    	<table width="50%" >
						<tr>
							<th>用户ID</th>
							<th>用户名</th>
							<th>密&nbsp;&nbsp;码</th>
							<th>备注信息</th>
							<th>操作</th>
						</tr>
					
				    		<logic:iterate id="userList" name="userList" type="org.srx.struts.form.UserForm">
				    		<tr>
				    			<td><bean:write name="userList" property="user_id" /></td>
				    			<td><bean:write name="userList" property="password" /></td>
				    			<td><bean:write name="userList" property="user_name" /></td>
				    			<td><bean:write name="userList" property="user_dac" /></td>
				    			<td><a href="userAction.do?method=deleteUser&user_id=<bean:write name="userList" property="user_id" />">删除</a></td>
				    		</tr>
				    		</logic:iterate>
				    		</table>
				    </div>
			    </div>
		    	</logic:present>
		    </logic:equal>
	      </logic:present>
  </body>
</html>
